package com.wencai.daily;

import java.io.File;

/**
 * @author wangpan
 * @date 2023/6/10
 */
public class RenameFiles {
    static String dir = "D:\\Users\\Administrator\\Desktop\\日线策略\\日线数据2022";

    public static void main(String[] args) {
        File f = new File(dir);
        String[] list = f.list();
        for (String str : list) {
            if (str.endsWith(".txt")) {
                String[] s = str.split("_");
                new File(f, str).renameTo(new File(dir, s[0] + ".txt"));
            }
        }
    }
}
